<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>后台管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/main.css"/>
    <script type="text/javascript" src="UI/admins/js/libs/modernizr.min.js"></script>
	
  </head>
  
  <body>
        <!--/sidebar-->
		<s:if test="message!=null">
		<script type="text/javascript">
			var msg = "${message}";
			alert(msg);
		</script>
		</s:if>
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i>首页<span class="crumb-step">&gt;</span><span class="crumb-name">自助终端管理</span></div>
        </div>
        
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="preAddMachine"><i class="icon-font"></i>新增终端</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
                            <th>编号</th>
                            <th>IP地址</th>
                            <th>所属一级片区</th>
                            <th>所属二级片区</th>
                            <th>片区负责人</th>
                            <th>柜子总数</th>
                            <th>柜子空闲数</th>
                            <th>柜子使用数</th>
                            <th>柜子维修数</th>
                            <th>加入时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        <s:iterator value="listmachine" var="lm">
                        	<tr>
                        	<td class="tc"><input name="id[]" value="59" type="checkbox"></td>
                        	<td><s:property value="#lm.id"/></td>
                        	<td><s:property value="#lm.ipAddress"/></td>
                        	<td><s:property value="#lm.machineaddress.machineaddress.name"/></td>
                        	<td><s:property value="#lm.machineaddress.name"/></td>
                        	<td><s:property value="#lm.admin.name"/></td>
                        	<td><s:property value="#lm.numAll"/></td>
                        	<td><s:property value="#lm.numAll-#lm.numUsed-#numRepair"  /></td>
                        	<td><s:property value="#lm.numUsed"/></td>
                        	<td><s:property value="#lm.numRepair" /></td>
                        	<td><s:date name="#lm.joinTime" format="yyyy-MM-dd HH:mm:ss"/></td>
                        	<td>
                        		<s:if test="#lm.state==1">
                        		运行
                        		</s:if>
                        		<s:elseif test="#lm.state==2">
                        		故障
                        		</s:elseif>
                        		<s:elseif test="#lm.state==3">
                        		维修
                        		</s:elseif>
                        		<s:elseif test="#lm.state==4">
                        		离线
                        		</s:elseif>
                        		<s:elseif test="#lm.state==5">
                        		删除
                        		</s:elseif>
                        	</td>
                        	<td>
                                <a class="link-update" href="preEditMachine?id=<s:property value="#lm.id"/>">修改</a>
                                
                            </td>
                        	</tr>
                        </s:iterator>
                    </table>
                    <div align="center" class="result-content">
			                    	<s:iterator value="pageBean">    
			                                <tr>    
			                                 <td colspan="6" align="center" bgcolor="#5BA8DE">    
			                                 共<s:property value="allRow"/>条记录        
			                                 共<s:property value="totalPage"/>页        
			                                 当前第<s:property value="currentPage"/>页<br>    
			                                
			                                 <s:if test="%{currentPage == 1}">    
			                                   第一页  上一页    
			                                 </s:if>    
			                                 <!-- currentPage为当前页 -->    
			                                 <s:else>    
			                                   <a href="listAllMachine.action?page=1">第一页</a>    
			                                   <a href="listAllMachine.action?page=<s:property value="%{currentPage-1}"/>">上一页</a>    
			                                 </s:else>    
			                                
			                                 <s:if test="%{currentPage != totalPage}">    
			                                 <a href="listAllMachine.action?page=<s:property value="%{currentPage+1}"/>">下一页</a>    
			                                 <a href="listAllMachine.action?page=<s:property value="totalPage"/>">最后一页</a>    
			                                 </s:if>    
			                                
			                                 <s:else>    
			                                 下一页  最后一页    
			                                 </s:else>    
			                                 </td>    
			                                </tr>    
			                        </s:iterator> 
                    </div>
                </div>
            </form>

        </div>
    <!--/main-->

  </body>
</html>
